// 增强版Markdown编辑器配置
        const simplemde = new SimpleMDE({
            element: document.getElementById("editor"),
            spellChecker: false,
            autosave: { enabled: true, uniqueId: "blogEditor" },
            placeholder: "开始写作...",
            toolbar: [
                "bold", "italic", "heading", "|",
                "code", "quote", "unordered-list", "ordered-list", "|",
                "link", "image", "table", "|",
                "preview", "side-by-side", "fullscreen", "|",
                "guide"
            ],
            styleSelectedText: false,
            indentWithTabs: false
        });

        // 标签输入功能增强
        const tagContainer = document.getElementById('tag-container');
        const tagInput = document.querySelector('#tags');

        tagInput.addEventListener('keypress', (e) => {
            if (e.key === 'Enter' || e.key === ',') {
                e.preventDefault();
                const tag = tagInput.value.trim();
                if (tag) {
                    addTag(tag);
                    tagInput.value = '';
                }
            }
        });

        function addTag(tag) {
            const tagElement = document.createElement('div');
            tagElement.className = 'tag-item';
            tagElement.innerHTML = `
                ${tag}
                <span class="tag-remove" onclick="this.parentElement.remove()">×</span>
            `;
            tagContainer.insertBefore(tagElement, tagInput);
        }

        // 表单提交前处理标签
        document.querySelector('form').addEventListener('submit', () => {
            const tags = Array.from(document.querySelectorAll('.tag-item'))
                .map(tag => tag.firstChild.textContent.trim());
            document.querySelector('#tags').value = tags.join(',');
        });
       document.addEventListener('DOMContentLoaded', function () {
            // 获取提交按钮
            const submitBtn = document.querySelector('.submit-btn');
            // 获取表单
            const form = document.querySelector('form');
            // 获取脉冲动画元素
            const pulseAnimation = document.querySelector('.pulse-animation');

            // 为提交按钮添加点击事件监听器
            submitBtn.addEventListener('click', function (event) {
                // 显示脉冲动画
                pulseAnimation.style.display = 'block';

                // 可以在这里添加额外的验证逻辑
                // 例如检查标题和内容是否为空，不过由于表单设置了 required 属性，浏览器会自动检查

                // 触发表单提交
                form.submit();
            });
        });